<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <title>玩AR游戏 赢虎扑好礼</title>
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/base.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="/static/summary/animate.min.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/swiper-3.3.1.min.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/vr.css" />

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/js.js"></script>
    <script src="/static/js/mod.js"></script>
    <script src="/static/summary/swiper-3.4.1.min.js"></script>
    <script src="/static/summary/swiper.animate1.0.2.min.js"></script>

</head>
<body>
    <section class="mod-box"> 
         <section class="img-box"></section>
        <section class="a-list">
            <a class="help">声援TA</a>
            <a href="http://a.mlinks.cc/Aagn">好吧！加入战斗</a>
        </section>
        <p class="p10 ac">
            <span  id="place" class="color-red"></span>
            出现在<br/>
            <span class="color-red">{$address}</span>
        </p>
        <dl class="rank-list"></dl>
        <a href="http://a.mlinks.cc/Aagn">
            <img class="footer-img" src="{$staticHost}/static/images/vr/text.png">
        </a>
    </section>
    <!-- 盒子 -->
    <script id="pet" type="text/html">
        <img src="{$staticHost}/static/images/vr/game_big_boss1.png">
        <p>
            {$tipsString}
        </p>
    </script>
    <script id="gameRank" type="text/html">
       <dt>累计帮助</dt>
       <% for(var i = 0; i < result.bufflist.length; i++) { %>
            <dd>
                <img src="<%if(result.bufflist[i].from_user.header){%><%=result.bufflist[i].from_user.header%><%}else{%>/static/images/4.jpg<%}%>">
                <span class="name"><%=result.bufflist[i].from_user.nickname%></span>
                <span class="num"><%=result.bufflist[i].buff_count%>次</span>
            </dd>
        <%}%>
    </script>
    <!-- 排行榜模板 -->
    <section class="masklayer" style="display:;">
        <div class="envelop-box">
            <div class="envelop-min">
                <i class="seal"></i>
                <div class="cover-di"></div>
                <div class="cover-body"></div>
                <div class="cover-gai"></div>
                <div class="cover-paper">
                   好像被TA弄丢了
                </div>
            </div>
        </div>
    </section>
</body>
 <script>
    rem();

    var to_uid ='{$to_uid}';
    var monster_id ='{$monster_id}';
    var boss_type = '{$boss_type}';
    var poi = '{$poi}';
    $.get('{$appHost}/gameWeb/getBuffList',{'uid':to_uid,'monster_id':monster_id,'limit':'10','page':'1' }, renderHome);

    function renderHome(data) {
        data = JSON.parse(data);
        var html = template('gameRank', data);
        $('.rank-list').html(html);
        var screenHeight = document.body.scrollHeight;
    }
    // 帮助列表
    $.get('{$appHost}/gameWeb/getBossInfo',{'boss_type':boss_type,'poi':poi}, petHome);
    function petHome(data) {
        data = JSON.parse(data);
        $("#place").html(data.result.name)
        var html = template('pet', data);
        $('.img-box').html(html);
    }
    // boss info
    $(".help").click(function(){
         $.post("{$appHost}/gameWeb/giveBuff",{'to_uid':to_uid}, function(data, error) {
            data = JSON.parse(data);
            var info = data.result.giftInfo;
             $(".masklayer").fadeIn()
             $(".seal").click(function(){
                if(info.name=='空'&&info.giftType==2){
                    $(".seal").addClass('seal-icon')
                    $(".cover-gai").addClass('open-gai')
                    $(".cover-paper").addClass('open-paper')
                    setTimeout(function(){ 
                     $(".masklayer").fadeOut();
                    },4000);

                }else if(info.name!='空'&&info.giftType==2){
                    window.location.href='ARcard?uid='+to_uid;
                }else{
                    window.location.href='ARaddress'
                }
            })
            $(".seal").removeClass('seal-icon')
            $(".cover-gai").removeClass('open-gai')
            $(".cover-paper").removeClass('open-paper')
        })
    })
   // 抽奖

</script>
{template 'show/web-footer'}